home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / explode < prev    next >
Text File  |  2001-04-06  |  995b  |  30 lines

  1. SYNOPSIS
  2.         string *explode(string str, string del)
  3.  
  4. DESCRIPTION
  5.         Return an array of strings, created when the string str is
  6.       split into substrings as divided by del.
  7.  
  8. EXAMPLES
  9.         string *strs;
  10.         strs = explode(" ab cd ef ", " ");
  11.         
  12.         This will return an array with five strings ({""
  13.         "ab","cd","ef" ""}).
  14.  
  15.         Not that the behaviour has changed at some point. In former
  16.         times it used to be an array with three strings
  17.         ({"ab","cd","ef"}), i.e. the empty strings were ignored.
  18.         The new behaviour is more consistent, because now
  19.         implode(explode(stri, "c"), "c") == str is always true.
  20.         
  21.         strs=explode("abc", "abc");   returns ({"",""})
  22.         
  23.         explode("", "")                      returns ({}).
  24.         
  25.         strs = explode("abc", "xyz"); returns ({ "abc" })
  26.         strs = explode("abc", "");    returns ({"a","b","c"})
  27.  
  28. SEE ALSO
  29.         sscanf(E), extract(E), implode(E), regexplode(E)
  30.